Game Development with GameMaker Studio 2 by Sebastiano M. Cossu

Game Development with GameMaker Studio 2 by Sebastiano M. Cossu

Author:Sebastiano M. Cossu
Language: eng
Format: epub
ISBN: 9781484250105
Publisher: Apress


Note

In the previous code, to check for the sign of hsp, we used the sign function .

sign(num) is a function that given a number num returns 1 if num is greater than 0, -1 if it’s less than zero, and 0 if it’s equal to 0.

Now open up room0 and add two instances of obj_block_brown or obj_block_red to the left and right side of obj_player instance. Running the game, you can verify that obj_player will collide with the blocks being unable to pass over them (Figure 8-5).

Figure 8-5Now we can block Berry using children of obj_block (in this case obj_block_brown)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.